<template>
  <transition name="slide">
    <div class="modal" v-show="show">
      <div class="mask"></div>
      <div class="modal-dailog">
        <div class="modal-header">
          <span>{{title}}</span>
          <a href="javascript:;" class="icon-close" @click="$emit('cancle')"></a>
        </div>
        <div class="modal-body">
          <!-- 插槽，主体部分 -->
          <slot name="body"></slot>
        </div>
        <div class="modal-footer">
          <a href="javascript:;" class="btn" v-if="btnType =='1'" @click="$emit('submit')">{{sureText}}</a>
          <a href="javascript:;" class="btn" v-else-if="btnType =='2'" @click="$emit('cancle')">{{cancleText}}</a>
          <div class="btn-group" v-else>
            <a href="javascript:;" class="btn">{{sureText}}</a>
            <a href="javascript:;" class="btn">{{cancleText}}</a>
          </div>
        </div>
      </div>
    </div>
  </transition>

</template>

<script>


export default {
  components: {

  },
  props: {
    // 弹框类型：小small，中middle，大large，表单form
    modalType: {
      type: String,
      default: 'form'
    },
    // 表单标题
    title: String,
    // 按钮类型 1:确定按钮,2:取消按钮,3:确定取消
    btnType: String,
    sureText: {
      type: String,
      default: '确定'
    },
    cancleText: {
      type: String,
      default: '取消'
    },
    show: {
      type: Boolean,
      default: false
    }
  },
  // 定义属性
  data () {
    return {

    }
  },
  methods: {
    cancle () {
      this.$emit('close', '111')
    }
  }
}
</script>

<style lang='scss'>
</style>